package com.chanjet.donkey.rest;

public class Result {
	public static final Result OK = new Result();
	private boolean success = true;
	private int errorCode;
	private String message = "";
	private Object data;
	
	public static Result ok(Object data) {
		Result ret = new Result();
		ret.data = data;
		return ret;
	}
	
	public static Result fail(String message) {
		Result ret = new Result();
		ret.message = message;
		return ret;
	}
	
	public boolean isSuccess() {
		return success;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}
	public int getErrorCode() {
		return errorCode;
	}
	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	
}
